<?php
session_start();
require('../conn.php');
require('../functions.php');
require('admin.php');
if ($_POST) {
    $name = guolv($_POST['name']);
    $type = guolv($_POST['type']);
    $directory = guolv($_POST['directory']);
    $remark = guolv($_POST['remark']);
    $state = guolv($_POST['state']);
    $mysql->execute("insert into `domain` values(null, '$name', '$type', '$directory', '$remark', '$state')");
    echo "<script>alert('添加成功');location.href='add_domain.php'</script>";
    exit;
} ?>

<?php include('head.php') ?>
<link rel="stylesheet" href="../editor/themes/default/default.css"/>
<link rel="stylesheet" href="../editor/plugins/code/prettify.css"/>
<script src="<?php echo $jquerysite ?>" type="text/javascript"></script>
<script charset="utf-8" src="../editor/kindeditor.js"></script>
<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../editor/plugins/code/prettify.js"></script>
<script>
    KindEditor.ready(function (K) {
        var editor1 = K.create('textarea[name="content"]', {
            cssPath: '../editor/plugins/code/prettify.css',
            uploadJson: '../editor/php/upload_json.php',
            fileManagerJson: '../editor/php/file_manager_json.php',
            allowFileManager: true,
        });
        prettyPrint();
    });
</script>
<div class="container-fluid">

    <div class="row-fluid">
        <?php
        include('left.php'); ?>
        <div class="span10">
            <h1 class="page-title">文章域名添加</h1>
            <!--
            <div class="btn-toolbar">
                <a href="#myModal" data-toggle="modal" class="btn">Delete</a>
              <div class="btn-group">
              </div>
            </div>
            -->
            <div class="well">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#home" data-toggle="tab">设置</a></li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="tab" action="add_domain.php" method="post">
                            <label>域名：</label>
                            <input type="text" style="width:300px" name="name" value="">
                            <code>如：www.baidu.com（开头不要带http://）</code>
                            <label>类型：</label>
                            <input type="text" style="width:300px" name="type" value="">
                            <label>目录：</label>
                            <input type="text" style="width:300px" name="directory" value="">
                            <label>备注：</label>
                            <input type="text" style="width:300px" name="remark" value="">
                            <label>状态：</label>
                            <select name="state">
                                <option value="0" selected="selected">未使用</option>
                                <option value="1">使用中</option>
                                <option value="2" >微信屏蔽</option>
                                <option value="3">已删除</option>
                            </select>

                            <label></label>
                            <button class="btn btn-primary"><i class="icon-save"></i> 添加</button>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>


</div>

<footer>
    <hr>

    <p class="pull-right"><!--power by right--></p>


    <p><!--power by --></p>
</footer>


<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="lib/bootstrap/js/bootstrap.js"></script>


</body>
</html>